from otree.api import *

doc = """
认知风格
"""


class C(BaseConstants):
    NAME_IN_URL = 'cs'
    PLAYERS_PER_GROUP = None
    NUM_ROUNDS = 1
    TABLE_STYLE = """
<style>
img {
  width: auto;
  height: 240px;
}
  /* 设置整个表格的样式 */
  table {
    width: 100%; /* 表格宽度 */
    border-collapse: collapse; /* 合并边框 */
    font-size: 0.9em; /* 字体大小 */
    font-family: sans-serif; /* 字体 */
    min-width: 380px; /* 最小宽度 */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); /* 阴影效果 */
  }

  /* 设置表头的样式 */
  th {
    background-color: #4286f4; /* 背景颜色 */
    color: white; /* 文字颜色 */
    text-align: left; /* 文字对齐 */
    padding: 12px 15px; /* 内边距 */
  }

  /* 设置表格标题的样式 */
  caption {
    padding: 10px; /* 内边距 */
    caption-side: bottom; /* 标题位置 */
    color: #888; /* 文字颜色 */
    font-size: 1em; /* 字体大小 */
    margin-top: 12px; /* 上边距 */
  }

  /* 设置单元格的样式 */
  td {
    background-color: #f7f7f7; /* 背景颜色 */
    color: #333; /* 文字颜色 */
    text-align: left; /* 文字对齐 */
    padding: 12px 15px; /* 内边距 */
  }

  /* 设置奇数行的背景颜色 */
  tr:nth-child(even) {
    background-color: #e7e7e7;
  }

  /* 设置鼠标悬停时的行样式 */
  tr:hover {
    background-color: #f1f1f1;
  }

  /* 设置表格边框 */
  th, td {
    border: 1px solid #ddd; /* 边框颜色 */
  }
</style>
    """


YES, NO = "是", "否"
AGREE_LST = [
    [1, '1:完全不符合'],
    [2, '2'],
    [3, '3'],
    [4, '4'],
    [5, '5:完全符合']
]
LABEL_PIC_COGNATIVE_STYPE = '您能很快从"复杂图形"中找出"简单图形"'


class Subsession(BaseSubsession):
    pass


class Group(BaseGroup):
    pass


class Player(BasePlayer):
    cs_part1_1 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_2 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_3 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_4 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_5 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_6 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_7 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_8 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part1_9 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)

    cs_part2_1 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_2 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_3 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_4 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_5 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_6 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_7 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_8 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_9 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_A = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part2_B = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)

    cs_part3_1 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_2 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_3 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_4 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_5 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_6 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_7 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_8 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_9 = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_A = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)
    cs_part3_B = models.StringField(choices=AGREE_LST, label=LABEL_PIC_COGNATIVE_STYPE,
                                    widget=widgets.RadioSelectHorizontal)


class CsBegin(Page):
    pass


class CsPart11(Page):
    form_model = 'player'
    form_fields = ['cs_part1_1']
    timeout_seconds = 60


class CsPart12(Page):
    form_model = 'player'
    form_fields = ['cs_part1_2']
    timeout_seconds = 60


class CsPart13(Page):
    form_model = 'player'
    form_fields = ['cs_part1_3']
    timeout_seconds = 60


class CsPart14(Page):
    form_model = 'player'
    form_fields = ['cs_part1_4']
    timeout_seconds = 60


class CsPart15(Page):
    form_model = 'player'
    form_fields = ['cs_part1_5']
    timeout_seconds = 60


class CsPart16(Page):
    form_model = 'player'
    form_fields = ['cs_part1_6']
    timeout_seconds = 60


class CsPart17(Page):
    form_model = 'player'
    form_fields = ['cs_part1_7']
    timeout_seconds = 60


class CsPart18(Page):
    form_model = 'player'
    form_fields = ['cs_part1_8']
    timeout_seconds = 60


class CsPart19(Page):
    form_model = 'player'
    form_fields = ['cs_part1_9']
    timeout_seconds = 60


class CsPart21(Page):
    form_model = 'player'
    form_fields = ['cs_part2_1']
    timeout_seconds = 60


class CsPart22(Page):
    form_model = 'player'
    form_fields = ['cs_part2_2']
    timeout_seconds = 60


class CsPart23(Page):
    form_model = 'player'
    form_fields = ['cs_part2_3']
    timeout_seconds = 60


class CsPart24(Page):
    form_model = 'player'
    form_fields = ['cs_part2_4']
    timeout_seconds = 60


class CsPart25(Page):
    form_model = 'player'
    form_fields = ['cs_part2_5']
    timeout_seconds = 60


class CsPart26(Page):
    form_model = 'player'
    form_fields = ['cs_part2_6']
    timeout_seconds = 60


class CsPart27(Page):
    form_model = 'player'
    form_fields = ['cs_part2_7']
    timeout_seconds = 60


class CsPart28(Page):
    form_model = 'player'
    form_fields = ['cs_part2_8']
    timeout_seconds = 60


class CsPart29(Page):
    form_model = 'player'
    form_fields = ['cs_part2_9']
    timeout_seconds = 60


class CsPart2A(Page):
    form_model = 'player'
    form_fields = ['cs_part2_A']
    timeout_seconds = 60


class CsPart2B(Page):
    form_model = 'player'
    form_fields = ['cs_part2_B']
    timeout_seconds = 60


class CsPart31(Page):
    form_model = 'player'
    form_fields = ['cs_part3_1']
    timeout_seconds = 60


class CsPart32(Page):
    form_model = 'player'
    form_fields = ['cs_part3_2']
    timeout_seconds = 60


class CsPart33(Page):
    form_model = 'player'
    form_fields = ['cs_part3_3']
    timeout_seconds = 60


class CsPart34(Page):
    form_model = 'player'
    form_fields = ['cs_part3_4']
    timeout_seconds = 60


class CsPart35(Page):
    form_model = 'player'
    form_fields = ['cs_part3_5']
    timeout_seconds = 60


class CsPart36(Page):
    form_model = 'player'
    form_fields = ['cs_part3_6']
    timeout_seconds = 60


class CsPart37(Page):
    form_model = 'player'
    form_fields = ['cs_part3_7']
    timeout_seconds = 60


class CsPart38(Page):
    form_model = 'player'
    form_fields = ['cs_part3_8']
    timeout_seconds = 60


class CsPart39(Page):
    form_model = 'player'
    form_fields = ['cs_part3_9']
    timeout_seconds = 60


class CsPart3A(Page):
    form_model = 'player'
    form_fields = ['cs_part3_A']
    timeout_seconds = 60


class CsPart3B(Page):
    form_model = 'player'
    form_fields = ['cs_part3_B']
    timeout_seconds = 60


page_sequence = [
    CsBegin,
    # CsPart11, CsPart12, CsPart13, CsPart14, CsPart15, CsPart16, CsPart17, CsPart18, CsPart19,
    CsPart21, CsPart22, CsPart23, CsPart24, CsPart25, CsPart26, CsPart27, CsPart28, CsPart29, CsPart2A, CsPart2B,
    CsPart31, CsPart32, CsPart33, CsPart34, CsPart35, CsPart3B, CsPart36, CsPart37, CsPart38, CsPart39, CsPart3A,
]
